home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / util / cdity / Yak210src.lha / Yak_2.10_Src / GetPubScreen.c < prev    next >
C/C++ Source or Header  |  1995-07-16  |  1KB  |  51 lines

  1.  
  2.  
  3. #include <exec/types.h>
  4. #include <intuition/screens.h>
  5. #include <proto/intuition.h>
  6.  
  7. #include "GetPubScreen.h"
  8.  
  9. UBYTE
  10. *GetPubScreenName( struct Screen *s)
  11. {
  12.     struct List *list; /*NMC*/
  13.     struct PubScreenNode *psnode; 
  14.     UBYTE *PSName;
  15.  
  16.     PSName = NULL;
  17.     if (s->Flags & WBENCHSCREEN)
  18.     {
  19.         PSName = "Workbench";
  20.     }
  21.     else
  22.     {
  23.         if (s->Flags & PUBLICSCREEN)
  24.         {
  25.             /* s is a public screen so find its name */
  26.  
  27.             if (list = LockPubScreenList()) /*NMC*/
  28.             {
  29.                 psnode = (struct PubScreenNode *) list->lh_Head; /*NMC*/
  30.  
  31.                 while ((psnode->psn_Node.ln_Succ) && !(PSName)) /*NMC*/
  32.                 {
  33.                     if (!(psnode->psn_Flags & PSNF_PRIVATE) && (psnode->psn_Screen == s))  /*NMC*/
  34.                     {
  35.                         /* found it */
  36.                         PSName = psnode->psn_Node.ln_Name;
  37.                     }
  38.                     else
  39.                     {       
  40.                         /* check next one */
  41.                         psnode = (struct PubScreenNode *)psnode->psn_Node.ln_Succ;
  42.                     }
  43.                 }
  44.             }
  45.  
  46.             UnlockPubScreenList();                
  47.         }
  48.     }
  49.     return(PSName);
  50. }
  51.